import Cookies from 'js-cookie'

// 持久化token
const TokenKey = 'hrsaas-ihrm-token'
const TimeKey = 'hrsaas-ihrm-time'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 读取时间戳
export function getTime() {
  return Cookies.get(TimeKey)
}

// 存入时间戳
export function setTime() {
  return Cookies.set(TimeKey, Date.now())
}

export function removeTime() {
  return Cookies.remove(TimeKey)
}
